// Sample program that shows how to invoke
// the Linux mktemp command and capture the output.
// (mktemp generates a guaranteed unique filename, creating
// a length 0 file of that name as it does so.)
// 'man mktemp' for details...

import java.io.*;
import java.lang.* ;

public class jmkTemp {
  public static void main(String[] args) throws IOException, InterruptedException {
    String cmd = "/home_dir/./my_shell_script.sh" ;
    Runtime run = Runtime.getRuntime() ;
    Process pr = run.exec("mktemp imageXXXXXX");
    pr.waitFor() ;
    BufferedReader buf = new BufferedReader( new InputStreamReader( pr.getInputStream() ) ) ;

    String filename = buf.readLine();
    System.out.println("'" + filename + "'") ;
  }

}